﻿using Gj;

public class ShowSize : NodeSize
{
    public ShowHelper showHelper;
    public float maxWidthRatio;
    public float maxHeightRation;

    protected override void OnRefresh(float rw, float rh, float w, float h, float s)
    {
        SetValue(w / h);
    }

    private void SetValue(float ratio)
    {
        if (maxWidthRatio > 0)
        {
            showHelper.SetData(ratio > maxWidthRatio);
        }
        else if (maxHeightRation > 0)
        {
            showHelper.SetData(ratio > maxHeightRation);
        }
    }
}